<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta name="description" content="Kevin ClassiK's Online Music Store" />
<meta name="keywords" content="MP3, Free, Downloads, Kevin Johnson, Music, Sound, Audio" />
<meta content="text/html" charset="utf-8" http-equiv="Content-Type" />

<script src="http://code.jquery.com/jquery-latest.js"></script>
<script src="<?=base_url()?>application/views/js/jquery-blink.js" language="javscript" type="text/javascript"></script>
<script src="<?=base_url()?>application/views/js/jquery.lint.js" language="javscript" type="text/javascript"></script>

<script type="text/javascript" language="javascript">
$(document).ready(function() {
	// blink script
	$('#notice').blink();

	$("#action_button").click(function() {
		var email = $("#email").val();
		var password = $("#password").val();
		var dataString = '&email=' + email + '&password=' + password;
		if(email=='' ||  password=='') {
			$('#success').fadeOut(400).hide();
			$('#error').fadeOut(400).show();
		} else {
			$.ajax({
			type: "POST",
			dataType: "JSON",
			url: "<?=base_url()?>index.php/home/logsig",
			data: dataString,
			json: {session_state: true},
			success: function(data){
			if(data.session_state == true) { // true means user is logged in.
				$("#main1").hide();
				$("#main1").load('<?=base_url()?>index.php/home/dashboard').fadeIn(400);
			} else if(data.session_state == false) { // false means user is being registered.
				$("#action_button").hide();
				$('#success').load('<?=base_url()?>index.php/home/register');
				// onLoad fadeIn
		   	}
		  }
	   });
	  }
	});
});
</script>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<title>Untitled 1</title>
<style type="text/css">
.auto-style1 {
	background-color: #FFFFFF;
	border-bottom-right-radius: 4px;
	border-bottom-left-radius: 4px;
}
.style1 {
	text-align: center;
}
.textbox {
	border-width: 1px;
	padding: 5px;
	font-family: Verdana;
	font-size: large;
	border-radius: 3px;
	border-style: solid;
	border-color: #C0C0C0;
	outline: none;
}
.style2 {
	font-family: Tahoma;
}
.style3 {
	font-size: large;
}
.style5 {
	font-family: Georgia;
	font-size: small;
}
.style7 {
	font-size: x-large;
}
.style8 {
	font-family: Verdana;
	font-size: 9pt;
}
.style9 {
	background-color: #CAFFCA;
}
.style10 {
	border-left: 1px dashed #C0C0C0;
}
.custom-scroll-area {
	height: 100%;
	overflow-x: hidden;
	overflow-y: scroll;
}
.site-details-pane {
	padding: 5px;
	font-family: Verdana;
	font-size: 9pt;
}
.style13 {
	border: 1px solid #C0C0C0;
	padding: 5px;
	font-family: Tahoma;
	font-size: large;
	border-radius: 3px;
	outline: none;
}
.auto-style2 {
	font-size: medium;
}
.action_button {
	background-color: #FFFFFF;
	border: 1px solid #C0C0C0;
	font-family: tahoma;
	font-size: 10pt;
	font-weight: bold;
	padding: 4px;
	margin: 3px;
	border-radius: 2px;
}
</style>
</head>

<body style="background-color: #51626F">

<table id="main1" style="width: 800px; position: fixed; top: -2px; right: 0px; left: 0px;" align="center">
	<tr>
		<td class="auto-style1">
		<table cellpadding="0" cellspacing="0" style="width: 797px; height: 450px">
			<!-- MSTableType="layout" -->
			<tr>
				<td valign="top" style="width: 503px" class="style1">
				<span class="style2"><strong><span class="style7">Login and 
				Register below!<br />
				</span></strong></span>
				<table style="width: 459px; height: 50px" align="center" class="style9">
					<tr>
						<td class="style8">
						<span id="notice" class="auto-style2"><strong>Please 
						read the following.</strong></span><br />
						If your not already registered with us, typing in a new 
					username and password will begin the registration process.</td>
					</tr>
				</table>
				<?php
				$dbhost = "localhost";
				$dbname = "druvla_public";
				$dbuser = "root";
				$dbpass = "";
				mysql_connect($dbhost, $dbuser, $dbpass)or die("Could Not Connect: " . mysql_error());
				mysql_select_db($dbname) or die(mysql_error());
				$results = mysql_query("SELECT id FROM users ORDER BY id DESC LIMIT 1");
				while($row = mysql_fetch_array($results)) {
				?>
				<span class="style2"><strong><span class="style3"><br />
				We have <?php echo $row['id']; ?> registered users.<br />
				</span></strong></span>
				<form method="post">
					<table style="width: 100%">
						<tr>
							<td>
							<table style="width: 100%" cellspacing="0" cellpadding="0">
								<tr>
									<td style="width: 208px">&nbsp;</td>
									<td class="style5"><em>Your new or existing 
									username</em></td>
								</tr>
							</table>
							</td>
						</tr>
						<tr>
							<td>
					<input id="email" name="email" autofocus class="style13" spellcheck="false" autocomplete="off" type="text" style="width: 400px" /></td>
						</tr>
						<tr>
							<td>
							<table style="width: 100%" cellspacing="0" cellpadding="0">
								<tr>
									<td style="width: 206px">&nbsp;</td>
									<td class="style5"><em>Your new or existing 
									password</em></td>
								</tr>
							</table>
							</td>
						</tr>
						<tr>
							<td>
					<input id="password" name="password" class="style13" spellcheck="false" autocomplete="off" type="password" style="width: 400px" /></td>
						</tr>
						<tr>
							<td>
							<table id="success" style="width: 100%" cellspacing="0" cellpadding="0">
								<tr>
									<td style="width: 208px">&nbsp;</td>
									<td class="style5">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
								<input name="action_button" id="action_button" type="button" value="Login/Register" class="action_button" /></td>
								</tr>
							</table>
							</td>
						</tr>
					</table>
					</form>
					</div>

				</td>
				<td valign="top" style="height: 450px; width: 294px" class="style10">
					<div class="custom-scroll-area">
						<div class="site-details-pane">
						</div>
					</div>
				</td>
			</tr>
		</table>
		</td>
	</tr>
</table>

</body>

</html>
<?php } ?>